import javax.media.opengl.GL;
import javax.media.opengl.GL2;
import javax.media.opengl.GLAutoDrawable;

public class Grid extends SceneGraphNode {
	private static final float HALF_SIZE = 5f;
	
	public Grid() {
		super(false);
	}

	public void renderGeometry(GLAutoDrawable drawable) {
		GL2 gl = drawable.getGL().getGL2();
		gl.glBegin(GL.GL_LINES);
		gl.glColor3f(1f, 0, 0);
		for (float x = -HALF_SIZE; x <= HALF_SIZE; x++) {
			gl.glVertex2f(-HALF_SIZE, x);
			gl.glVertex2f(HALF_SIZE, x);
			gl.glVertex2f(x, -HALF_SIZE);
			gl.glVertex2f(x, HALF_SIZE);
		}
		gl.glEnd();
	}
}
